home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 4154 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.8 KB

  1. Path: erich.triumf.ca!bennett
  2. From: bennett@erich.triumf.ca (P.Bennett)
  3. Newsgroups: crl.general,comp.sys.sun.misc,comp.unix.sys5.misc,comp.lang.c,sci.math
  4. Subject: Re: Problem with C for the mathematical programm
  5. Date: 1 Feb 1996 21:59 PST
  6. Organization: TRIUMF: Tri-University Meson Facility
  7. Distribution: world
  8. Message-ID: <1FEB199621595021@erich.triumf.ca>
  9. References: <4epq2e$h4b@crl2.crl.com> <4erfj5$f5c@canb.cin.gov.au>
  10. NNTP-Posting-Host: ftp.triumf.ca
  11. News-Software: VAX/VMS VNEWS 1.50    
  12.  
  13. In article <4erfj5$f5c@canb.cin.gov.au>, rossw@cin.gov.au (Ross Wilson) writes...
  14. >sorkin@crl.com (Iouri Sorkine) wrote:
  15.  
  16. >>I execute "cc name.c" and receive "ld: Undefined symbol
  17. >>                                       _cos
  18. >>                                       _sin
  19. >>and so on...                                ". 
  20. >>What's wrong?        
  21.  
  22. >You will need to include the math library.  How you do this depends on
  23. >what operating system and/or compiler you are using.
  24.  
  25. >If you use UNIX, do:
  26. >    cc -lm name.c
  27.  
  28. Although I don't do unix, I've seen this often enough to know that libraries
  29. _must_ be listed at the _end_ of the command line:
  30.     cc name.c -lm
  31. >If you use Borland, Microsoft, whatever, you will have to read the
  32. >manual.
  33.  
  34. Borland and Microsoft very nicely put the math functions in the main library,
  35. so you don't have to worry about this nonsense - MS-DOS _does_ have some
  36. advantages  :-)
  37.  
  38. >Don't forget to #include <math.h>.
  39.  
  40.  
  41. Peter Bennett VE7CEI                | Vessels shall be deemed to be in sight
  42. Internet: bennett@triumf.ca         | of one another only when one can be
  43. Packet: ve7cei@ve7kit.#vanc.bc.ca   | observed visually from the other
  44. TRIUMF, Vancouver, B.C., Canada     |                          ColRegs 3(k)
  45. GPS and NMEA info and programs: ftp://sundae.triumf.ca/pub/peter/index.html
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.